import React from "react";

export default class Child1 extends React.Component {
  constructor() {
    super();
    this.state = { input1: 0 };
  }

  componentDidMount() {
    this.setState({ input1: this.props.money });
  }

  changeHander = (e) => {
    this.setState({ input1: e.target.value });
  };

  render() {
    return (
      <>
        <input
          type="text"
          value={this.state.input1}
          onChange={this.changeHander}
        />
        <p>{this.props.money}</p>
      </>
    );
  }
}
